/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
}

header h1 {
    font-size: 2.5em;
}

.add-form {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.add-form h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.assignments-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.assignments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.assignment-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.assignment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.card-header {
    background-color: #2196F3;
    color: white;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
}

.card-body {
    padding: 20px;
}

.card-body .description {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
}

.card-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.assignment-number {
    background-color: #FF9800;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    margin-right: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .assignments-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }

    /* 智能客服小窗样式 */
    .chat-widget {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 350px;
        background: white;
        border-radius: 10px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
        border: 1px solid #e0e0e0;
        z-index: 1000;
        overflow: hidden;
        font-family: 'Arial', sans-serif;
    }

    .chat-header {
        background: linear-gradient(135deg, #4CAF50, #45a049);
        padding: 15px 20px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: bold;
        color: white;
        transition: background-color 0.3s;
    }

    .chat-header:hover {
        background: linear-gradient(135deg, #45a049, #3d8b40);
    }

    .chat-content {
        transition: all 0.3s ease;
    }

    .chat-messages {
        height: 300px;
        overflow-y: auto;
        padding: 20px;
        background: #fafafa;
        border-bottom: 1px solid #e0e0e0;
    }

    .chat-input {
        display: flex;
        gap: 10px;
        padding: 15px;
        background: white;
    }

    .chat-input input {
        flex: 1;
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 14px;
        transition: border-color 0.3s;
    }

    .chat-input input:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
    }

    .chat-input button {
        padding: 12px 20px;
        background: #4CAF50;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-weight: bold;
        transition: background-color 0.3s;
        white-space: nowrap;
    }

    .chat-input button:hover {
        background: #45a049;
    }

    /* 消息样式 */
    .message {
        padding: 12px 16px;
        margin-bottom: 15px;
        border-radius: 18px;
        max-width: 85%;
        word-wrap: break-word;
        word-break: break-word;
        font-size: 14px;
        line-height: 1.4;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .user-message {
        background: linear-gradient(135deg, #4CAF50, #45a049);
        color: white;
        margin-left: auto;
        text-align: right;
        border-bottom-right-radius: 6px;
    }

    .bot-message {
        background: white;
        color: #333;
        margin-right: auto;
        border: 1px solid #e0e0e0;
        border-bottom-left-radius: 6px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
        .chat-widget {
            width: calc(100% - 40px);
            right: 20px;
            left: 20px;
            bottom: 20px;
        }

        .chat-messages {
            height: 250px;
            padding: 15px;
        }

        .message {
            max-width: 90%;
        }
    }

    /* 滚动条样式 */
    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}
